#include <stdio.h>

void reverseArray(int *arr, int size)
{
    int *start = arr;
    int *end = arr + size -1;

    while(start < end)
    {
        int temp = *start;
        *start =  *end;
        *end = temp;

        start++;
        end++;
    }
}

int main()
{
    int arr[5] = {1, 2, 3, 4, 5};
    int size = sizeof(arr)/sizeof(arr[0]);
    
    printf("转换前：\n");
    for(int i = 0;  i < size; i++)
    {
        printf("%d ", *(arr + i));
    }
    printf("\n");

    reverseArray(arr, size);

    printf("转换后：\n");
    for(int i = 0; i < size; i++)
    {
        printf("%d ",  *(arr + i));
    }
    printf("\n");
}